<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/4/12
 * Time: 16:14
 */

pcntl_signal(SIGIO, 'sig_handler');

function sig_handler($sig) {
    sleep(2);
    echo 'this is sign test class';
}

// 根据进程pid 设置信号
posix_kill(posix_getpid(), SIGIO);


echo 'other thing';

pcntl_signal_dispatch();